/**
 * 
 */
package image;

import image.bmp.BMPImage;

/**
 * @author nquangtrung
 *
 */
public class HexaPlet extends BMPImage {
	/**
	 * 
	 */
	public HexaPlet(Image image, int left, int down) {
		this.setColorMap(new RGBColor[8][8]);
		
		int imgWidth = image.getWidth();
		int imgHeight = image.getHeight();
		for (int x = 0; x < 8; x++) {
			for (int y = 0; y < 8; y++) {
				if (left + x < imgWidth && down + y < imgHeight) {
					int r = image.getRed(x, y);
					int g = image.getGreen(x, y);
					int b = image.getBlue(x, y);
					RGBColor color = new RGBColor(r, g, b);
					this.setRGBColor(x, y, color);
				}
			}
		}
	}
	@Override
	public int getWidth() {
		return 8;
	}
	@Override
	public int getHeight() {
		return 8;
	}
}